package com.sfzlot.dev.netty.bean.data;

import java.util.Date;

import com.sfzlot.dev.netty.bean.inf.Data;
import com.sfzlot.dev.netty.utils.ByteUtil;

/**
 * 设备登出信息请求体
 * Created by pierr on 2017/5/30.
 */
public class DeviceLogoutInData implements Data {
    
    private Date dataCollectTime;	// 数据采集时间
    private int serialNum;		// 登出流水号

    public Date getDataCollectTime() {
        return dataCollectTime;
    }

    public void setDataCollectTime(Date dataCollectTime) {
        this.dataCollectTime = dataCollectTime;
    }

    public int getSerialNum() {
        return serialNum;
    }

    public void setSerialNum(int i) {
        this.serialNum = i;
    }

    
	@Override
	public String toString() {
		return "DeviceLogoutInData [dataCollectTime=" + dataCollectTime + ", serialNum=" + serialNum 
				+ "]";
	}

	@Override
	public byte[] toBytes(){
		byte[] dateBytes = ByteUtil.timeToBytes(dataCollectTime);
		byte[] serialNumBytes = ByteUtil.shortToBytes(Integer.valueOf(serialNum).shortValue());
		return ByteUtil.addAll(dateBytes, serialNumBytes);
	}

	@Override
	public String transData() {
		return "DeviceLogoutInData(设备登出请求信息体) [dataCollectTime=" + dataCollectTime + ", serialNum=" + serialNum 
				+ "]";
	}
}
